Event recognition

ABSTRACT

A method executes software including a view hierarchy with a plurality of views which displays one or more views of the view hierarchy. The method executes software elements associated with a particular view, wherein each particular view includes event recognizers. Each event recognizer has an event definition based on sub-events, and an event handler that specifies an action for a target, and is configured to send the action to the target in response to an event recognition. The method detects a sequence of sub-events, and identifies one of the views of the view hierarchy as a hit view that establishes which views in the hierarchy are actively involved views. The method delivers a respective sub-event to event recognizers for each actively involved view, wherein each event recognizer for actively involved views in the view hierarchy processes the respective sub-event prior to processing a next sub-event in the sequence of sub-events.

RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.14/180,267, filed Feb. 13, 2014, which is continuation of U.S.application Ser. No. 13/620,390, filed Sep. 14, 2012, now U.S. Pat. No.8,682,602, which is a continuation of U.S. patent application Ser. No.12/566,660, filed Sep. 24, 2009, now U.S. Pat. No. 8,285,499, whichclaims priority to U.S. Provisional Patent Application No. 61/210,332,“Event Recognition,” filed on Mar. 16, 2009, which are incorporated byreference herein in their entirety.

TECHNICAL FIELD

The disclosed embodiments relate generally to user interface processing.More particularly, the disclosed embodiments relate to apparatuses andmethods for recognizing user interface events.

BACKGROUND

A computing device typically includes a user interface that may be usedto interact with the computing device. The user interface may include adisplay and/or input devices such as a keyboard, mice, andtouch-sensitive surfaces for interacting with various aspects of theuser interface. In some devices with a touch-sensitive surface as aninput device, a first set of touch-based gestures (e.g., two or more of:tap, double tap, horizontal swipe, vertical swipe, pinch, depinch, twofinger swipe) are recognized as proper inputs in a particular context(e.g., in a particular mode of a first application), and other,different sets of touch-based gestures are recognized as proper inputsin other contexts (e.g., different applications and/or different modesor contexts within the first application). As a result, the software andlogic required for recognizing and responding to touch-based gesturescan become complex, and can require revision each time an application isupdated or a new application is added to the computing device. These andsimilar issues may arise in user interfaces that utilize input sourcesother than touch-based gestures.

Thus, it would be desirable to have a comprehensive framework ormechanism for recognizing touch-based gestures and events, as well asgestures and events from other input sources, that is easily adaptableto virtually all contexts or modes of all application programs on acomputing device, and that requires little or no revision when anapplication is updated or a new application is added to the computingdevice.

SUMMARY

To address the aforementioned drawbacks, some embodiments provide amethod, which, at an electronic device configured to execute softwarethat includes a view hierarchy with a plurality of views: displays oneor more views of the view hierarchy; executes one or more softwareelements, each software element being associated with a particular view,wherein each particular view includes one or more event recognizers.Each event recognizer has an event definition based on one or moresub-events, and an event handler, wherein the event handler specifies anaction for a target, and is configured to send the action to the targetin response to the event recognizer detecting an event corresponding tothe event definition. The method also detects a sequence of one or moresub-events, and identifies one of the views of the view hierarchy as ahit view, wherein the hit view establishes which views in the viewhierarchy are actively involved views. The method also delivers arespective sub-event to event recognizers for each actively involvedview within the view hierarchy, wherein each event recognizer foractively involved views in the view hierarchy processes the respectivesub-event prior to processing a next sub-event in the sequence ofsub-events.

Some embodiments provide a method, which, at an electronic deviceconfigured to execute software that includes a view hierarchy with aplurality of views: displays one or more views of the view hierarchy;executes one or more software elements, each software element beingassociated with a particular view, wherein each particular view includesone or more event recognizers. Each event recognizer has an eventdefinition based on one or more sub-events, and an event handler,wherein the event handler specifies an action for a target, and isconfigured to send the action to the target in response to the eventrecognizer detecting an event corresponding to the event definition. Themethod also detects a sequence of one or more sub-events, and identifiesone of the views of the view hierarchy as a hit view, wherein the hitview establishes which views in the view hierarchy are actively involvedviews. The method also delivers a respective sub-event to eventrecognizers for each actively involved view within the view hierarchy,and makes a sub-event recognition decision while processing therespective sub-event at event recognizers for the actively involvedviews in the view hierarchy.

Some embodiments provide a computer readable storage medium storing oneor more programs for execution by one of more processors of a computersystem or device, the one or more programs including one or moreapplication programs for displaying one or more views of a viewhierarchy with a plurality of views. The one or more applicationprograms include one or more software elements, each software elementbeing associated with a particular view, wherein each particular viewincludes one or more event recognizers. Each event recognizer has anevent definition based on one or more sub-events, and an event handler,wherein the event handler: specifies an action for a target, and isconfigured to send the action to the target in response to the eventrecognizer detecting an event corresponding to the event definition;event management instructions, which when executed by the one or moreprocessors of the computer system or device, cause the computer systemor device to: detect a sequence of one or more sub-events; identify oneof the views of the view hierarchy as a hit view, wherein the hit viewestablishes which views in the view hierarchy are actively involvedviews; and deliver a respective sub-event to event recognizers for eachactively involved view within the view hierarchy, wherein each eventrecognizer for actively involved views in the view hierarchy processesthe respective sub-event prior to processing a next sub-event in thesequence of sub-events.

Some embodiments provide an apparatus comprising a display, one or moreprocessors, memory, and one or more programs stored in the memory, whichare configured to display one or more views of a view hierarchy with aplurality of views. The one or more programs include one or moresoftware elements, each software element being associated with aparticular view, wherein each particular view includes one or more eventrecognizers. The event recognizers have an event definition based on oneor more sub-events, and an event handler, wherein the event handlerspecifies an action for a target, and is configured to send the actionto the target in response to the event recognizer detecting an eventcorresponding to the event definition. The apparatus's programs alsoinclude an event delivery program, which, when executed by the one ormore processors of the apparatus, cause the apparatus to detect asequence of one or more sub-events; identify one of the views of theview hierarchy as a hit view, wherein the hit view establishes whichviews in the view hierarchy are actively involved views; and make asub-event recognition decision while event recognizers for the activelyinvolved views in the view hierarchy process the respective sub-event.

In some embodiments, an apparatus is provided that comprises one or moreprocessors, memory, and one or more programs stored in the memory, whichare configured to manage execution of one or more programmatic layers ofa programmatic hierarchy with a plurality of programmatic layers. Theone or more programs include one or more software elements, eachsoftware element being associated with a particular programmatic layer,wherein each particular programmatic layer includes one or more eventrecognizers. The event recognizers have an event definition based on oneor more sub-events, and an event handler, wherein the event handlerspecifies an action for a target and is configured to send the action tothe target in response to the event recognizer detecting an eventcorresponding to the event definition. The apparatus also includes anevent delivery program, which, when executed by the one or moreprocessors of the apparatus, cause the apparatus to detect a sequence ofone or more sub-events; identify one of the programmatic layers of theprogrammatic hierarchy as a hit layer, wherein the hit layer establisheswhich programmatic layers in the programmatic hierarchy are activelyinvolved programmatic layers; and deliver a respective sub-event toevent recognizers for each actively involved programmatic layer withinthe programmatic hierarchy, wherein each event recognizer for activelyinvolved layers in the programmatic hierarchy processes the respectivesub-event prior to processing a next sub-event in the sequence ofsub-events.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are block diagrams illustrating electronic devices,according to some embodiments.

FIG. 2 is a diagram of an input/output processing stack of an exemplaryelectronic device according to some embodiments.

FIG. 3A illustrates an exemplary view hierarchy, according to someembodiments.

FIGS. 3B and 3C are block diagrams illustrating exemplary eventrecognizer methods and data structures, according to some embodiments.

FIGS. 4A and 4B are flow charts illustrating exemplary state machines,according to some embodiments.

FIG. 4C illustrates the exemplary state machines of FIGS. 4A and 4B toan exemplary set of sub-events, according to some embodiments.

FIGS. 5A-5C illustrate exemplary sub-event sequences with exemplaryevent recognizer state machines, according to some embodiments.

FIGS. 6A and 6B are event recognition method flow diagrams, according tosome embodiments.

Like reference numerals refer to corresponding parts throughout thedrawings.

DESCRIPTION OF EMBODIMENTS

Reference will now be made in detail to embodiments, examples of whichare illustrated in the accompanying drawings. In the following detaileddescription, numerous specific details are set forth in order to providea thorough understanding of the present invention. However, it will beapparent to one of ordinary skill in the art that the present inventionmay be practiced without these specific details. In other instances,well-known methods, procedures, components, circuits, and networks havenot been described in detail so as not to unnecessarily obscure aspectsof the embodiments.

It will also be understood that, although the terms first, second, etc.may be used herein to describe various elements, these elements shouldnot be limited by these terms. These terms are only used to distinguishone element from another. For example, a first contact could be termed asecond contact, and, similarly, a second contact could be termed a firstcontact, without departing from the scope of the present invention. Thefirst contact and the second contact are both contacts, but they are notthe same contact.

The terminology used in the description of the invention herein is forthe purpose of describing particular embodiments only and is notintended to be limiting of the invention. As used in the description ofthe invention and the appended claims, the singular forms “a”, “an” and“the” are intended to include the plural forms as well, unless thecontext clearly indicates otherwise. It will also be understood that theterm “and/or” as used herein refers to and encompasses any and allpossible combinations of one or more of the associated listed items. Itwill be further understood that the terms “comprises” and/or“comprising,” when used in this specification, specify the presence ofstated features, integers, steps, operations, elements, and/orcomponents, but do not preclude the presence or addition of one or moreother features, integers, steps, operations, elements, components,and/or groups thereof.

As used herein, the term “if” may be construed to mean “when” or “upon”or “in response to determining” or “in response to detecting,” dependingon the context. Similarly, the phrase “if it is determined” or “if [astated condition or event] is detected” may be construed to mean “upondetermining” or “in response to determining” or “upon detecting (thestated condition or event)” or “in response to detecting (the statedcondition or event),” depending on the context.

As noted above, in some devices with a touch-sensitive surface as aninput device, a first set of touch-based gestures (e.g., two or more of:tap, double tap, horizontal swipe, vertical swipe) are recognized asproper inputs in a particular context (e.g., in a particular mode of afirst application), and other, different sets of touch-based gesturesare recognized as proper inputs in other contexts (e.g., differentapplications and/or different modes or contexts within the firstapplication). As a result, the software and logic required forrecognizing and responding to touch-based gestures can become complex,and can require revision each time an application is updated or a newapplication is added to the computing device.

In the embodiments described below, touch-based gestures are events.Upon recognition of a predefined event, e.g., an event that correspondsto a proper input in the current context of an application, informationconcerning the event is delivered to the application. In the context ofthis document, all touch-based gestures correspond to events.Furthermore, each respective event is defined as a sequence ofsub-events. In devices that have a multi-touch display device (oftenherein called “screens”) or other multi-touch sensitive surface, andthat accept multi-touch-based gestures, the sub-events that define amulti-touched based event may include multi-touch sub-events (requiringtwo or more fingers to be simultaneously in contact with the device'stouch-sensitive surface). For example, in a device having a multi-touchsensitive display, a respective multi-touch sequence of sub-events maybegin when a user's finger first touches the screen. Additionalsub-events may occur when one or more additional fingers subsequently orconcurrently touch the screen, and yet other sub-events may occur whenall of the fingers touching the screen move across the screen. Thesequence ends when the last of the user's fingers is lifted from thescreen.

When using touch-based gestures to control an application running in adevice having a touch-sensitive surface, touches have both temporal andspatial aspects. The temporal aspect, called a phase, indicates when atouch has just begun, whether it is moving or stationary, and when itends—that is, when the finger is lifted from the screen. A spatialaspect of a touch is the set of views or user interface windows in whichthe touch occurs. The views or windows in which a touch is detected maycorrespond to programmatic levels within a programmatic or viewhierarchy. For example, the lowest level view in which a touch isdetected may be called the hit view, and the set of events that arerecognized as proper inputs may be determined based, at least in part,on the hit view of the initial touch that begins a touch-based gesture.

FIGS. 1A and 1B are block diagrams illustrating electronic devices 102and 104, according to some embodiments. The electronic devices 102 and104 may be any electronic device including, but not limited to, adesktop computer system, a laptop computer system, mobile phone, a smartphone, a personal digital assistant, or a navigation system. Theelectronic device may also be a portable electronic device with a touchscreen display (e.g., display 156, FIG. 1B) configured to present a userinterface, a computer with a touch screen display configured to presenta user interface, a computer with a touch sensitive surface and adisplay configured to present a user interface, or any other form ofcomputing device, including without limitation, consumer electronicdevices, mobile telephones, video game systems, electronic musicplayers, tablet PCs, electronic book reading systems, e-books, PDAs,electronic organizers, email devices, laptops or other computers, kioskcomputers, vending machines, smart appliances, etc. The electronicdevices 102 and 104 may include user interfaces 113-A and 113-B,respectively.

In some embodiments, the electronic devices 102 and 104 include a touchscreen display. In these embodiments, the user interface 113 (i.e.,113-A or 113-B) may include an on-screen keyboard (not depicted) that isused by a user to interact with the electronic devices 102 and 104.Alternatively, a keyboard may be separate and distinct from theelectronic devices 102 and 104. For example, a keyboard may be a wiredor wireless keyboard coupled to the electronic devices 102 or 104.

In some embodiments, the electronic device 102 includes a display 126and one or more input devices 128-A (e.g., keyboard, mouse, trackball,microphone, physical button(s), touchpad, etc.) that are coupled to theelectronic device 102. In these embodiments, one or more of the inputdevices 128-A may optionally be separate and distinct from theelectronic device 102. For example, the one or more input devices mayinclude one or more of: a keyboard, a mouse, a trackpad, a trackball,and an electronic pen, any of which may optionally be separate from theelectronic device. Optionally, the device 102 or 104 may include one ormore sensors 130, such as one or more accelerometers, gyroscopes, GPSsystems, speakers, infrared (IR) sensors, biometric sensors, cameras,etc. It is noted that the description above of various exemplary devicesas input devices 128 or as sensors 130 is of no significance to theoperation of the embodiments described herein, and that any input orsensor device herein described as an input device may equally well bedescribed as a sensor, and vice versa. In some embodiments, signalsproduced by the one or more sensors 130 are used as input sources fordetecting events.

In some embodiments, the electronic device 104 includes atouch-sensitive display 156 (i.e., a display having a touch-sensitivesurface) and one or more input devices 128-B that are coupled to theelectronic device 104. In some embodiments, the touch-sensitive display156 has the ability to detect two or more distinct, concurrent (orpartially concurrent) touches, and in these embodiments, the display 156is sometimes herein called a multitouch display or multitouch-sensitivedisplay.

In some embodiments of the electronic device 102 or 104 discussedherein, the input devices 128 are disposed in the electronic device 102or 104. In other embodiments, one or more of the input devices 128 isseparate and distinct from the electronic device 102 or 104; forexample, one or more of the input devices 128 may be coupled to theelectronic device 102 or 104 by a cable (e.g., USB cable) or wirelessconnection (e.g., Bluetooth connection).

When using the input devices 128, or when performing a touch-basedgesture on the touch-sensitive display 156 of an electronic device 102or 104, respectively, the user generates a sequence of sub-events thatare processed by one or more CPUs 110 of the electronic device 102 or104. In some embodiments, the one or more CPUs 110 of the electronicdevice 102 or 104 process the sequence of sub-events to recognizeevents.

The electronic device 102 or 104 typically includes one or more single-or multi-core processing units (“CPU” or “CPUs”) 110 as well as one ormore network or other communications interfaces 112, respectively. Theelectronic device 102 or 104 includes memory 111 and one or morecommunication buses 115, respectively, for interconnecting thesecomponents. The communication buses 115 may include circuitry (sometimescalled a chipset) that interconnects and controls communications betweensystem components (not depicted herein). As discussed briefly above, theelectronic devices 102 and 104 optionally include user interfaces 113that include a display 126 and multitouch display 156, respectively.Further, the electronic devices 102 and 104 typically include inputdevices 128 (e.g., keyboard, mouse, touch screens, touch sensitivesurfaces, multitouch screens, keypads, etc.). In some embodiments, theinput devices include an on-screen input device (e.g., a touch-sensitivesurface of a display device). Memory 111 may include high-speed randomaccess memory, such as DRAM, SRAM, DDR RAM or other random access solidstate memory devices; and may include non-volatile memory, such as oneor more magnetic disk storage devices, optical disk storage devices,flash memory devices, or other non-volatile solid state storage devices.Memory 111 may optionally include one or more storage devices remotelylocated from the CPU(s) 110. Memory 111, or alternately the non-volatilememory device(s) within memory 111, comprise a computer readable storagemedium. In some embodiments, memory 111 stores the following programs,modules and data structures, or a subset thereof:

-   -   an operating system 118 that includes procedures for handling        various basic system services and for performing hardware        dependent tasks;    -   a communication module 120 (in electronic devices 102 and 104,        respectively) that is used for connecting the electronic device        102 or 104, respectively, to other devices via their one or more        respective communication interfaces 112 (wired or wireless) and        one or more communication networks, such as the Internet, other        wide area networks, local area networks, metropolitan area        networks, and so on;    -   an event delivery system 122 (in electronic devices 102 and 104,        respectively) that may be implemented in various alternate        embodiments within the operating system 118 or in application        software 124; in some embodiments, however, some aspects of        event delivery system 122 may be implemented in the operating        system 118 while other aspects are implemented in application        software 124; and    -   one or more applications in application software 124,        respectively (e.g., an email application, a web browser        application, a text messaging application, etc.).

Each of the above identified elements may be stored in one or more ofthe previously mentioned memory devices, and corresponds to a set ofinstructions for performing functions described herein. The set ofinstructions can be executed by one or more processors (e.g., the one ormore CPUs 110). The above identified modules or programs (i.e., sets ofinstructions) need not be implemented as separate software programs,procedures or modules, and thus various subsets of these modules may becombined or otherwise rearranged in various embodiments. In someembodiments, memory 111 may store a subset of the modules and datastructures identified above. Furthermore, memory 111 may storeadditional modules and data structures not described above.

FIG. 2 is a diagram of an input/output processing stack 200 of anexemplary electronic device or apparatus (e.g., device 102 or 104)according to some embodiments of the invention. The hardware (e.g.,electronic circuitry) 212 of the device is at the base level of theinput/output processing stack 200. Hardware 212 can include varioushardware interface components, such as the components depicted in FIGS.1A and/or 1B. Hardware 212 can also include one or more of the abovementioned sensors 130. All the other elements (202-210) of theinput/output processing stack 200 are software procedures, or portionsof software procedures, that process inputs received from the hardware212 and generate various outputs that are presented through a hardwareuser interface (e.g., one or more of a display, speakers, devicevibration actuator).

A driver or a set of drivers 210 communicates with the hardware 212. Thedrivers 210 can receive and process input data received from thehardware 212. A core Operating System (“OS”) 208 can communicate withthe driver(s) 210. The core OS 208 can process raw input data receivedfrom the driver(s) 210. In some embodiments, the drivers 210 can beconsidered to be a part of the core OS 208.

A set of OS application programming interfaces (“OS APIs”) 206, aresoftware procedures that communicate with the core OS 208. In someembodiments, the APIs 206 are included in the device's operating system,but at a level above the core OS 208. The APIs 206 are designed for useby applications running on the electronic devices or apparatusesdiscussed herein. User interface (UI) APIs 204 can utilize the OS APIs206. Application software (“applications”) 202 running on the device canutilize the UI APIs 204 in order to communicate with the user. The UIAPIs 204 can, in turn, communicate with lower level elements, ultimatelycommunicating with various user interface hardware, e.g., multitouchdisplay 156.

While each layer input/output processing stack 200 can utilize the layerunderneath it, that is not always required. For example, in someembodiments, applications 202 can occasionally communicate with OS APIs206. In general, layers at or above the OS API layer 206 may notdirectly access the Core OS 208, driver(s) 210, or hardware 212, asthese layers are considered private. Applications in layer 202 and theUI API 204 usually direct calls to the OS API 206, which in turn,accesses the layers Core OS 208, driver(s) 210, and hardware 212.

Stated in another way, one or more hardware elements 212 of theelectronic device 102 or 104, and software running on the device, suchas, for example, drivers 210 (depicted in FIG. 2), core OS (operatingsystem) 208 (depicted in FIG. 2), operating system API software 206(depicted in FIG. 2), and Application and User Interface API software204 (depicted in FIG. 2) detect input events (which may correspond tosub-events in a gesture) at one or more of the input device(s) 128and/or a touch-sensitive display 156 and generate or update various datastructures (stored in memory of the device 102 or 104) used by a set ofcurrently active event recognizers to determine whether and when theinput events correspond to an event to be delivered to an application202. Embodiments of event recognition methodologies, apparatus andcomputer program products are described in more detail below.

FIG. 3A depicts an exemplary view hierarchy 300, which in this exampleis a search program displayed in outermost view 302. Outermost view 302generally encompasses the entire user interface a user may directlyinteract with, and includes subordinate views, e.g.,

-   -   search results panel 304, which groups search results and can be        scrolled vertically;    -   search field 306, which accepts text inputs; and    -   a home row 310, which groups applications for quick access.

In this example, each subordinate view includes lower-level subordinateviews. In other examples, the number of view levels in the hierarchy 300may differ in different branches of the hierarchy, with one or moresubordinate views having lower-level subordinate views, and one or moreother subordinate views not have any such lower-level subordinate views.Continuing with the example shown in FIG. 3A, search results panel 304contains separate subordinate views 305 (subordinate to the panel 304)for each search result. Here, this example shows one search result in asubordinate view called the maps view 305. Search field 306 includes asubordinate view herein called the clear contents icon view 307, whichclears the contents of the search field when a user performs aparticular action (e.g., a single touch or tap gesture) on the clearcontents icon in the view 307. Home row 310 includes subordinate views310-1, 310-2, 310-3, and 310-4, which respectively correspond to acontacts application, an email application, a web browser, and an iPodmusic interface.

A touch sub-event 301-1 is represented in outermost view 302. Given thelocation of touch sub-event 301-1 over both the search results panel304, and maps view 305, the touch sub-event is also represented overthose views as 301-2 and 301-3, respectively. Actively involved views ofthe touch sub-event include the views search results panel 304, mapsview 305 and outermost view 302. Additional information regardingsub-event delivery and actively involved views is provided below withreference to FIGS. 3B and 3C.

Views (and corresponding programmatic levels) can be nested. In otherwords, a view can include other views. Consequently, the softwareelement(s) (e.g., event recognizers) associated with a first view caninclude or be linked to one or more software elements associated withviews within the first view. While some views can be associated withapplications, others can be associated with high level OS elements, suchas graphical user interfaces, window managers, etc.

To simplify subsequent discussion, reference will generally be made onlyto views and the view hierarchy, but it must be understood that in someembodiments, the method may operate with a programmatic hierarchy with aplurality of programmatic layers, and/or a view hierarchy.

FIGS. 3B and 3C depict exemplary methods and structures related to eventrecognizers. FIG. 3B depicts methods and data structures for eventhandling when event handlers are associated with particular views withina hierarchy of views. FIG. 3C depicts methods and data structures forevent handling when event handlers are associated with particular levelswithin a hierarchy of programmatic levels. Event recognizer globalmethods 312 and 350 include hit view and hit level determination modules314 and 352, respectively, active event recognizer determination modules316 and 354, and sub-event delivery modules 318 and 356.

Hit view and hit level determination modules, 314 and 352, respectively,provide software procedures for determining where a sub-event has takenplace within one or more views, e.g., the exemplary view hierarchy 300depicted in FIG. 3A, which has three main branches.

The hit view determination module 314 of FIG. 3B, receives informationrelated to a sub-event, e.g., a user touch represented as 301-1 on theoutermost view 302, on a search result (map view 305) and the searchresults panel view 304. The hit view determination module 314 identifiesa hit-view as the lowest view in the hierarchy which should handle thesub-event. In most circumstances, the hit view is the lowest level viewin which an initiating sub-event (i.e., the first sub-event in thesequence of sub-events that form an event or potential event) occurs.Once the hit-view is identified, it will receive all sub-events relatedto the same touch or input source for which the hit view was identified.

In some embodiments, the hit level determination module 352 of FIG. 3Cmay utilize an analogous process.

Active event recognizer determination modules 316 and 354 of eventrecognizer global methods 312 and 350, respectively, determine whichview or views within a view hierarchy should receive a particularsequence of sub-events. FIG. 3A depicts an exemplary set of activeviews, 302, 304 and 305, that receive the sub-event 301. In the exampleof FIG. 3A, the active event recognizer determination module 316 woulddetermine that the top level view 302, search results panel 304 and mapsview 305 are actively involved views because these views include thephysical location of the touch represented by sub-event 301. It is notedthat even if touch sub-event 301 were entirely confined to the areaassociated with map view 305, search results panel 304 and top levelview 302 would still remain in the actively involved views since thesearch results panel 304 and the top level view 302 are ancestors of mapview 305.

In some embodiments, active event recognizer determination modules 316and 354 utilize analogous processes.

Sub-event delivery module 318 delivers sub-events to event recognizersfor actively involved views. Using the example of FIG. 3A, a user'stouch is represented in different views of the hierarchy by touch marks301-1, 301-2, and 301-3. In some embodiments, sub-event datarepresenting this user's touch is delivered by the sub-event deliverymodule 318 to event recognizers at the actively involved views, i.e.,top level view 302, search results panel 304 and maps view 305. Further,the event recognizers of a view can receive subsequent sub-events of anevent that starts within the view (e.g., when an initial sub-eventoccurs within the view). Stated in another way, a view can receivesub-events associated with user interactions beginning in the view, evenif it continues outside of the view.

In some embodiments, sub-event delivery module 356 delivers sub-eventsto event recognizers for actively involved programmatic levels in aprocess analogous to that used by sub-event delivery module 318.

In some embodiments, a separate event recognizer structure 320 or 360 isgenerated and stored in memory of the device for each actively involvedevent recognizer. Event recognizer structures 320 and 360 typicallyinclude an event recognizer state 334, 374, respectively (discussed ingreater detail below when referring to FIGS. 4A and 4B), and eventrecognizer specific code 338, 378, respectively, having state machines340, 380, respectively. Event recognizer structure 320 also includes aview hierarchy reference 336, while event recognizer structure 360includes a programmatic hierarchy reference 376. Each instance of aparticular event recognizer references exactly one view or programmaticlevel. View hierarchy reference 336 or programmatic hierarchy reference376 (for a particular event recognizer) are used to establish which viewor programmatic level is logically coupled to the respective eventrecognizer.

View metadata 341 and level metadata 381 may include data regarding aview or level, respectively. View or level metadata may include at leastthe following properties that may influence sub-event delivery to eventrecognizers:

-   -   A stop property 342, 382, which, when set for a view or        programmatic level prevents sub-event delivery to event        recognizers associated with the view or programmatic level as        well as its ancestors in the view or programmatic hierarchy.    -   A skip property 343, 383, which, when set for a view or        programmatic level prevents sub-event delivery to event        recognizers associated with that view or programmatic level, but        permits sub-event delivery to its ancestors in the view or        programmatic hierarchy.    -   A NoHit skip property 344, 384, which, when set for a view,        prevents delivery of sub-events to event recognizers associated        with the view unless the view is the hit view. As discussed        above, the hit view determination module 314 identifies a        hit-view (or hit-level in the case of hit-level determination        module 352) as the lowest view in the hierarchy which should        handle the sub-event.

Event recognizer structures 320 and 360 may include metadata 322, 362,respectively. In some embodiments, the metadata 322, 362 includesconfigurable properties, flags, and lists that indicate how the eventdelivery system should perform sub-event delivery to actively involvedevent recognizers. In some embodiments, metadata 322, 362 may includeconfigurable properties, flags, and lists that indicate how eventrecognizers may interact with one another. In some embodiments, metadata322, 362 may include configurable properties, flags, and lists thatindicate whether sub-events are delivered to varying levels in the viewor programmatic hierarchy. In some embodiments, the combination of eventrecognizer metadata 322, 362 and view or level metadata (341, 381,respectively) are both be used to configure the event delivery systemto: a) perform sub-event delivery to actively involved eventrecognizers, b) indicate how event recognizers may interact with oneanother, and c) indicate whether and when sub-events are delivered tovarious levels in the view or programmatic hierarchy.

It is noted that, in some embodiments, a respective event recognizersends an event recognition action 333, 373 to its respective target 335,375, as specified by fields of the event recognizer's structure 320,360. Sending an action to a target is distinct from sending (anddeferred sending) sub-events to a respective hit view or level.

The metadata properties stored in a respective event recognizerstructure 320, 360 of a corresponding event recognizer includes atleast:

-   -   An exclusivity flag 324, 364, which, when set for an event        recognizer, indicates that upon recognition of an event by the        event recognizer, the event delivery system should stop        delivering sub-events to any other event recognizers of the        actively involved views or programmatic levels (with the        exception of any other event recognizers listed in an exception        list 326, 366). When receipt of a sub-event causes a particular        event recognizer to enter the exclusive state, as indicated by        its corresponding exclusivity flag 324 or 364, then subsequent        sub-events are delivered only to the event recognizer in the        exclusive state (as well as any other event recognizers listed        in an exception list 326, 366).    -   Some event recognizer structures 320, 360, may include an        exclusivity exception list 326, 366. When included in the event        recognizer structure 320, 360 for a respective event recognizer,        this list 326, 366 indicates the set of event recognizers, if        any, that are to continue receiving sub-events even after the        respective event recognizer has entered the exclusive state. For        example, if the event recognizer for a single tap event enters        the exclusive state, and the currently involved views include an        event recognizer for a double tap event, then the list 326, 366        would list the double tap event recognizer so that a double tap        event can be recognized even after a single tap event has been        detected. Accordingly, the exclusivity exception list 326, 366        permits event recognizers to recognize different events that        share common sequences of sub-events, e.g., a single tap event        recognition does not preclude subsequent recognition of a double        or triple tap event by other event recognizers.    -   Some event recognizer structures 320, 360, may include a        wait-for list 327, 367. When included in the event recognizer        structure 320, 360 for a respective event recognizer, this list        327, 367 indicates the set of event recognizers, if any, that        must enter the event impossible or event canceled state before        the respective event recognizer can recognize a respective        event. In effect, the listed event recognizers have higher        priority for recognizing an event than the event recognizer with        the wait-for list 327, 367.    -   A delay touch began flag 328, 368, which, when set for an event        recognizer, causes the event recognizer to delay sending        sub-events (including a touch begin or finger down sub-event,        and subsequent events) to the event recognizer's respective hit        view or level until after it has been determined that the        sequence of sub-events does not correspond to this event        recognizer's event type. This flag can be used to prevent the        hit view or level from ever seeing any of the sub-events in the        case where the gesture is recognized. When the event recognizer        fails to recognize an event, the touch began sub-event (and        sub-sequent touch end sub-event) can be delivered to the hit        view or level. In one example, delivering such sub-events to the        hit view or level causes the user interface to briefly highlight        an object, without invoking the action associated with that        object.    -   A delay touch end flag 330, 370, which, when set for an event        recognizer, causes the event recognizer to delay sending a        sub-event (e.g., a touch end sub-event) to the event        recognizer's respective hit view or level until it has been        determined that the sequence of sub-events does not correspond        to this event recognizer's event type. This can be used to        prevent the hit view or level from acting upon a touch end        sub-event, in case the gesture is late recognized. As long as        the touch end sub-event is not sent, a touch canceled can be        sent to the hit view or level. If an event is recognized, the        corresponding action by an application is preformed, and the        touch end sub-event is delivered to the hit view or level.    -   A touch cancellation flag 332, 372, which, when set for an event        recognizer, causes the event recognizer to send touch or input        cancellation to the event recognizer's respective hit view or        hit level when it has been determined that the sequence of        sub-events does not correspond to this event recognizer's event        type. The touch or input cancellation sent to the hit view or        level indicates that a prior sub-event (e.g., a touch began        sub-event) has been cancelled. The touch or input cancellation        may cause the input source handler's state (see FIG. 4B) to        enter the input sequence cancelled state 460 (discussed below).

In some embodiments, the exception list 326, 366 can also be used bynon-exclusive event recognizers. In particular, when a non-exclusiveevent recognizer recognizes an event, subsequent sub-events are notdelivered to the exclusive event recognizers associated with thecurrently active views, except for those exclusive event recognizerslisted in the exception list 326, 366 of the event recognizer thatrecognized the event.

In some embodiments, event recognizers may be configured to utilize thetouch cancellation flag in conjunction with the delay touch end flag toprevent unwanted sub-events from being delivered to the hit view. Forexample, the definition of a single tap gesture and the first half of adouble tap gesture are identical. Once a single tap event recognizersuccessfully recognizes a single tap, an undesired action could takeplace. If the delay touch end flag is set, the single tap eventrecognizer is prevented from sending sub-events to the hit view until asingle tap event is recognized. In addition, the wait-for list of thesingle tap event recognizer may identify the double-tap eventrecognizer, thereby preventing the single tap event recognizer fromrecognizing a single tap until the double-tap event recognizer hasentered the event impossible state. The use of the wait-for list avoidsthe execution of actions associated with a single tap when a double tapgesture is performed. Instead, only actions associated with a double tapwill be executed, in response to recognition of the double tap event.

Turning in particular to forms of user touches on touch-sensitivesurfaces, as noted above, touches and user gestures may include an actthat need not be instantaneous, e.g., a touch can include an act ofmoving or holding a finger against a display for a period of time. Atouch data structure, however, defines the state of a touch (or, moregenerally, the state of any input source) at a particular time.Therefore, the values stored in a touch data structure may change overthe course of a single touch, enabling the state of the single touch atdifferent points in time to be conveyed to an application.

Each touch data structure can comprise various fields. In someembodiments, touch data structures may include data corresponding to atleast the touch-specific fields 339 in FIG. 3B or input source specificfields 379 in FIG. 3C.

For example, a “first touch for view” field 345 in FIG. 3B (385 for“first touch for level” in FIG. 3C) can indicate whether the touch datastructure defines the first touch for the particular view (since thesoftware element implementing the view was instantiated). A “time stamp”field 346, 386 can indicate the particular time to which the touch datastructure relates.

Optionally, an “info” field 347, 387 can be used to indicate if a touchis a rudimentary gesture. For example, the “info” field 347, 387 canindicate whether the touch is a swipe and, if so, in which direction theswipe is oriented. A swipe is a quick drag of one or more fingers in astraight direction. API implementations (discussed below) can determineif a touch is a swipe and pass that information to the applicationthrough the “info” field 347, 387, thus alleviating the application ofsome data processing that would have been necessary if the touch were aswipe.

Optionally, a “tap count” field 348 in FIG. 3B (“event count” field 388in FIG. 3C) can indicate how many taps have been sequentially performedat the position of the initial touch. A tap can be defined as a quickpressing and lifting of a finger against a touch-sensitive panel at aparticular position. Multiple sequential taps can occur if the finger isagain pressed and released in quick succession at the same position ofthe panel. An event delivery system 122 can count taps and relay thisinformation to an application through the “tap count” field 348.Multiple taps at the same location are sometimes considered to be auseful and easy to remember command for touch enabled interfaces. Thus,by counting taps, the event delivery system 122 can again alleviate somedata processing from the application.

A “phase” field 349, 389 can indicate a particular phase the touch-basedgesture is currently in. The phase field 349, 389 can have variousvalues, such as “touch phase began” which can indicate that the touchdata structure defines a new touch that has not been referenced byprevious touch data structures. A “touch phase moved” value can indicatethat the touch being defined has moved from a prior position. A “touchphase stationary” value can indicate that the touch has stayed in thesame position. A “touch phase ended” value can indicate that the touchhas ended (e.g., the user has lifted his/her finger from the surface ofa multi touch display). A “touch phase cancelled” value can indicatethat the touch has been cancelled by the device. A cancelled touch canbe a touch that is not necessarily ended by a user, but which the devicehas determined to ignore. For example, the device can determine that thetouch is being generated inadvertently (i.e., as a result of placing aportable multi touch enabled device in one's pocket) and ignore thetouch for that reason. Each value of the “phase field” 349, 389 can be ainteger number.

Thus, each touch data structure can define what is happening with atouch (or other input source) at a particular time (e.g., whether thetouch is stationary, being moved, etc.) as well as other informationassociated with the touch (such as position). Accordingly, each touchdata structure can define the state of a particular touch at aparticular moment in time. One or more touch data structures referencingthe same time can be added in a touch event data structure that candefine the states of all touches a particular view is receiving at amoment in time (as noted above, some touch data structures may alsoreference touches that have ended and are no longer being received).Multiple touch event data structures can be sent to the softwareimplementing a view as time passes, in order to provide the softwarewith continuous information describing the touches that are happening inthe view.

The ability to handle complex touch-based gestures, optionally includingmulti-touch gestures, can add complexity to the various softwareelements. In some cases, such additional complexity can be necessary toimplement advanced and desirable interface features. For example, a gamemay require the ability to handle multiple simultaneous touches thatoccur in different views, as games often require the pressing ofmultiple buttons at the same time, or combining accelerometer data withtouches on a touch-sensitive surface. However, some simpler applicationsand/or views (and their associated software elements) need not requireadvanced interface features. For example, a simple soft button (i.e., abutton that is displayed on a touch-sensitive display) may operatesatisfactorily with single touches, rather than multi-touchfunctionality. In these cases, the underlying OS may send unnecessary orexcessive touch data (e.g., multi-touch data) to a software elementassociated with a view that is intended to be operable by single touchesonly (e.g., a single touch or tap on a soft button). Because thesoftware element may need to process this data, it may need to featureall the complexity of a software element that handles multiple touches,even though it is associated with a view for which only single touchesare relevant. This can increase the cost of development of software forthe device, because software elements that have been traditionally easyto program in a mouse interface environment (i.e., various buttons,etc.) may be much more complex in a multi-touch environment.

It shall be understood, however, that the foregoing discussion regardingthe complexity of evaluating and processing user touches ontouch-sensitive surfaces also applies to all forms of user inputs tooperate electronic devices 102 and 104 with input-devices, 128 and 158,respectively, not all of which are initiated on touch screens, e.g.,coordinating mouse movement and mouse button presses with or withoutsingle or multiple keyboard presses or holds, user movements taps,drags, scrolls, etc., on touch-pads, pen stylus inputs, oralinstructions, detected eye movements, biometric inputs, detectedphysiological change in a user, and/or any combination thereof, whichmay be utilized as inputs corresponding to sub-events which define anevent to be recognized.

FIG. 4A depicts an event recognizer state machine 400 containing fourstates. By managing state transitions in event recognizer state machine400 based on received sub-events, an event recognizer effectivelyexpresses an event definition. For example, a tap gesture may beeffectively defined by a sequence of two, or optionally, threesub-events. First, a touch should be detected, and this will besub-event 1. For example, the touch sub-event may be a user's fingertouching a touch-sensitive surface in a view that includes the eventrecognizer having state machine 400. Second, an optional measured delaywhere the touch does not substantially move in any given direction(e.g., any movement of the touch position is less than a predefinedthreshold, which may be measured as a distance (e.g., 5 mm) or as anumber of pixels (e.g., 5 pixels) on the display), and the delay issufficiently short, would serve as sub-event 2. Finally, termination ofthe touch (e.g., liftoff of the user's finger from the touch-sensitivesurface) will serve as sub-event 3. By coding the event recognizer statemachine 400 to transition between states based upon receiving thesesub-events, the event recognizer state machine 400 effectively expressesa tap gesture event definition.

Regardless of event type, the event recognizer state machine 400 beginsin an event recognition begins state 405, and may progress to any of theremaining states depending on what sub-event is received. To facilitatediscussion of the event recognizer state machine 400, the direct pathsfrom the event recognition begins state 405 to the event recognizedstate 415, the event possible state 410, and event impossible state 420will be discussed, followed by a description of the paths leading fromthe event possible state 410.

Starting from event recognition begins state 405, if a sub-event isreceived that, by itself comprises the event definition for an event,the event recognizer state machine 400 will transition to eventrecognized state 415.

Starting from state event recognition begins 405, if a sub-event isreceived that is not the first sub-event in an event definition, theevent recognizer state machine 400 will transition to event impossiblestate 420.

Starting from event recognition begins state 405, if a sub-event isreceived that is the first and not final sub-event in a given eventdefinition, the event recognizer state machine 400 will transition toevent possible state 410. If the next sub-event received is a secondsub-event, but not the final sub-event in the given event definition,the event recognizer state machine 400 will remain in state eventpossible 410. The event recognizer state machine 400 can remain in stateevent possible 410 for as long as the sequence of received sub-eventscontinues to be part of the event definition. If, at any time the eventrecognizer state machine 400 is in event possible state 410, and theevent recognizer state machine 400 receives a sub-event that is not partof the event definition, it will transition to state event impossible420, thereby determining that the current event (if any) is not the typeof event that corresponds to this event recognizer (i.e., the eventrecognizer corresponding to state 400). If, on the other hand, the eventrecognizer state machine 400 is in the event possible state 410, and theevent recognizer state machine 400 receives the last sub-event in anevent definition, it will transition to the event recognized state 415,thereby completing a successful event recognition.

FIG. 4B depicts an embodiment of an input source handling process 440,having a finite state machine representing how views receive informationabout a respective input. It is noted that when there are multipletouches on the touch-sensitive surface of a device, each of the touchesis a separate input source having its own finite state machine. In thisembodiment, input source handling process 440 includes four states:input sequence begin 445, input sequence continues 450, input sequenceended 455, and input sequence cancelled 460. Input source handlingprocess 440 may be used by a respective event recognizer, for example,when input is to be delivered to an application, but only after thecompletion of an input sequence is detected. Input source handlingprocess 440 can be used with an application that is incapable ofcanceling or undoing changes made in response to an input sequencedelivered to the application.

Starting from input sequence begin 445, if an input is received that, byitself completes an input sequence, input source handling process 440will transition to input sequence ended 455.

Starting from input sequence begin 445, if an input is received thatindicates the input sequence terminated, input source handling process440 will transition to input sequence cancelled 460.

Starting from input sequence begin 445, if an input is received that isthe first and not final input in a input sequence, input source handlingprocess 440 will transition to state input sequence continues 450. Ifthe next input received is the second input in an input sequence, theinput handling process 440 will remain in state input sequence continues450. Input source handling process 440 can remain in state inputsequence continues 450 for as long as the sequence of sub-events beingdelivered continue to be part of a given input sequence. If, at any timeinput source handling process 440 is in state input sequence continues450, and input source handling process 440 receives an input that is notpart of the input sequence, it will transition to state input sequencecancelled 460. If, on the other hand, input source handling process 440is in input sequence continues 450, and the input handling process 440receives the last input in a given input definition, it will transitionto the input sequence ended 455, thereby successfully receiving a groupof sub-events.

In some embodiments, input source handling process 440 may beimplemented for particular views or programmatic levels. In that case,certain sequences of sub-events may result in transitioning to stateinput cancelled 460.

As an example, consider FIG. 4C, which supposes an actively involvedview, represented only by actively involved view input source handler480 (hereafter “view 480”). View 480 includes a vertical swipe eventrecognizer, represented only by vertical swipe event recognizer 468(hereafter “recognizer 468”) as one of its event recognizers. In thiscase, the recognizer 468 may require as part of its definitiondetecting: 1) a finger down 465-1; 2) an optional short delay 465-2; 3),vertical swiping of at least N pixels 465-3; and 4) a finger liftoff465-4.

For this example, the recognizer 468 also has its delay touch began flag328 and touch cancellation flag 332 set. Now consider delivery of thefollowing sequence of sub-events to recognizer 468, as well as the view480:

-   -   sub-event sequence 465-1: detect finger down, which corresponds        to recognizer 468's event definition    -   sub-event sequence 465-2: measure delay, which corresponds to        recognizer 468's event definition    -   sub-event sequence 465-3: finger performs a vertical swiping        movement compatible with vertical scrolling, but is less than N        pixels, and therefore does not correspond to recognizer 468's        event definition    -   sub-event sequence 465-4: detect finger liftoff, which        corresponds to recognizer 468's event definition

Here, recognizer 468 would successfully recognize sub-events 1 and 2 aspart of its event definition, and accordingly, would be in state eventpossible 472 immediately prior to the delivery of sub-event 3. Sincerecognizer 468 has its delay touch began flag 328 set, the initial touchsub-event is not sent to the hit view. Correspondingly, the view 480'sinput source handling process 440 would still be in state input sequencebegin immediately prior to the delivery of sub-event 3.

Once delivery of sub-event 3 to recognizer 468 is complete, recognizer468's state transitions to event impossible 476, and importantly, therecognizer 468 has now determined that the sequence of sub-events doesnot correspond to its specific vertical swipe gesture event type (i.e.,it has decided the event is not a vertical swipe. In other words,recognition 474 as a vertical swipe does not occur in this example). Theinput source handling system 440 for view input source handler 480 willalso update its state. In some embodiments, the state of the view inputsource handler 480 would proceed from the input sequence begins state482 to the input sequence continues state 484 when the event recognizersends status information indicating that it has begun recognizing anevent. The view input source handler 480 proceeds to the input sequencecancelled state 488 when the touch or input ends without an event beingrecognized because the touch cancellation flag 322 of the eventrecognizer has been set. Alternately, if the touch cancellation flag 322of the event recognizer had not been set, the view input source handler480 proceeds to the input sequence ended state 486 when the touch ofinput ends.

Since event recognizer 468's touch cancellation flag 332 is set, whenthe event recognizer 468 transitions to the event impossible state 476,the recognizer will send a touch cancellation sub-event or message tothe hit view corresponding to the event recognizer. As a result, theview input source handler 480 will transition to the state inputsequence cancelled 488.

In some embodiments, delivery of sub-event 465-4 is not germane to anyevent recognition decisions made by recognizer 468, though view inputsource handler 480's other event recognizers, if any, may continue toanalyze the sequence of sub-events.

The following table presents in summarized tabular format the processingof this exemplary sub-event sequence 465 as related to the state ofevent recognizer 468 described above, along with the state of view inputsource handler 480. In this example, the state of the view input sourcehandler 480 proceeds from input sequence begin 445 to input sequencecancelled 488 because recognizer 468's touch cancellation flag 332 wasset:

Sub-Event Sequence State: Recognizer 465 468 State: View 480 beforedelivery Event Recognition starts Begins 470 detect finger down EventPossible 472 Input Sequence 465-1 Begins 482 measure delay 465-2 EventPossible 472 Input Sequence Continues 484 detect finger vertical EventImpossible Input Sequence swipe 465-3 476 Continues 484 detect fingerliftoff Event Impossible Input Sequence 465-4 476 Cancelled 488

Turning to FIG. 5A, attention is directed to an example of a sub-eventsequence 520, which is being received by a view that includes aplurality of event recognizers. For this example, two event recognizersare depicted in FIG. 5A, scrolling event recognizer 580 and tap eventrecognizer 590. For purposes of illustration, the view search resultspanel 304 in FIG. 3A will be related to the reception of the sub-eventsequence 520, and the state transitions in scrolling event recognizer580 and tap event recognizer 590. Note that in this example, thesequence of sub-events 520 defines a tap finger gesture on atouch-sensitive display or trackpad, but the same event recognitiontechnique could be applied in myriad contexts, e.g., detecting a mousebutton press, and/or in embodiments utilizing programmatic hierarchiesof programmatic levels.

Before the first sub-event is delivered to view search results panel304, event recognizers 580 and 590 are in the event recognition beginsstates 582 and 592, respectively. Following touch 301, which isdelivered as sub-event detect finger down 521-1 to actively involvedevent recognizers for view search results panel 304 as touch sub-event301-2 (as well as to actively involved event recognizers for map view305 as touch sub-event 301-3), scrolling event recognizer 580transitions to state event possible 584, and similarly, tap eventrecognizer 590 transitions to state event possible 594. This is becausethe event definition of a tap and a scroll both begin with a touch suchas detecting a finger down on a touch-sensitive surface.

Some definitions of tap and scroll gestures may optionally include adelay between an initial touch and any next step in the eventdefinition. In all examples discussed here, the exemplar eventdefinitions for both tap and scroll gestures recognize a delay sub-eventfollowing the first touch sub-event (detect finger down).

Accordingly, as sub-event measure delay 521-2 is delivered to eventrecognizers 580 and 590, both remain in the event possible states 584and 594, respectively.

Finally, sub-event detect finger liftoff 521-3 is delivered to eventrecognizers 580 and 590. In this case, the state transitions for eventrecognizers 580 and 590 are different, because the event definitions fortap and scroll are different. In the case of scrolling event recognizer580, the next sub-event to remain in state event possible would be todetect movement. Since the sub-event delivered is detect finger liftoff521-3, however, the scrolling event recognizer 580 transitions to stateevent impossible 588. A tap event definition concludes with a fingerliftoff sub-event though. Accordingly, tap event recognizer 590transitions to state event recognized 596 after sub-event detect fingerliftoff 521-3 is delivered.

Note that in some embodiments, as discussed above with respect to FIGS.4B and 4C, the input source handling process 440 discussed in FIG. 4Bmay be used for various purposes at the view level. The following tablepresents in summarized tabular format the delivery of sub-event sequence520 as related to event recognizers 580, 590, and input source handlingprocess 440:

State: Scrolling State: Input Sub-Event Event Recognizer State: TapEvent Source Handling Sequence 520 580 Recognizer 590 Process 440 beforedelivery Event Recognition Event Recognition starts Begins 582 Begins592 Detect Finger Event Possible Event Possible Input Sequence Down521-1 584 594 Begin 445 Measure Delay Event Possible Event PossibleInput Sequence 521-2 584 594 Continues 450 Detect Finger Eventimpossible Event Recognized Input Sequence Liftoff 521-3 588 596 Ended455

Turning to FIG. 5B, attention is directed to another example of asub-event sequence 530, which is being received by a view that includesa plurality of event recognizers. For this example, two eventrecognizers are depicted in FIG. 5B, scrolling event recognizer 580 andtap event recognizer 590. For purposes of illustration, the view searchresults panel 304 in FIG. 3A will be related to the reception of thesub-event sequence 530, and the state transitions in scrolling eventrecognizer 580 and tap event recognizer 590. Note that in this example,the sequence of sub-events 530 defines a scroll finger gesture on atouch-sensitive display, but the same event recognition technique couldbe applied in myriad contexts, e.g., detecting a mouse button press,mouse movement, and mouse button release, and/or in embodimentsutilizing programmatic hierarchies of programmatic levels.

Before the first sub-event is delivered to actively involved eventrecognizers for view search results panel 304, event recognizers 580 and590 are in the event recognition begins states 582 and 592,respectively. Following delivery of sub-events corresponding to touch301 (as discussed above), scrolling event recognizer 580 transitions tostate event possible 584, and similarly, tap event recognizer 590transitions to state event possible 594.

As sub-event measure delay 531-2 is delivered to event recognizers 580and 590, both transition to the event possible states 584 and 594,respectively.

Next, sub-event detect finger movement 531-3 is delivered to eventrecognizers 580 and 590. In this case, the state transitions for eventrecognizers 580 and 590 are different because the event definitions fortap and scroll are different. In the case of scrolling event recognizer580, the next sub-event to remain in state event possible is to detectmovement, so the scrolling event recognizer 580 remains in the eventpossible state 584 when it receives sub-event detect finger movement531-3. As discussed above, however, the definition for a tap concludeswith a finger liftoff sub-event, so tap event recognizer 590 transitionsto the state event impossible 598.

Finally, sub-event detect finger liftoff 531-4 is delivered to eventrecognizers 580 and 590. Tap event recognizer is already in the eventimpossible state 598, and no state transition occurs. Scrolling eventrecognizer 580's event definition concludes with detecting a fingerliftoff. Since the sub-event delivered is detect finger liftoff 531-4,the scrolling event recognizer 580 transitions to state event recognized586. It is noted that a finger movement on a touch sensitive surface maygenerate multiple movement sub-events, and therefore a scroll may berecognized before liftoff and continue until liftoff.

The following table presents in summarized tabular format the deliveryof sub-event sequence 530 as related to event recognizers 580, 590, andinput source handling process 440:

State: Scrolling State: Input Sub-Event Event Recognizer State: TapEvent Source Handling Sequence 530 580 Recognizer 590 Process 440 beforedelivery Event Recognition Event Recognition starts Begins 582 Begins592 detect finger Event Possible Event Possible Input Sequence down531-1 584 594 Begins 445 measure delay Event Possible Event PossibleInput sequence 531-2 584 594 continues 450 detect finger Event PossibleEvent Impossible Input sequence movement 531-3 584 598 continues 450detect finger Event Recognized Event Impossible Input sequence liftoff531-4 586 598 ended 455

Turning to FIG. 5C, attention is directed to another example of asub-event sequence 540, which is being received by a view that includesa plurality of event recognizers. For this example, two eventrecognizers are depicted in FIG. 5C, double tap event recognizer 570 andtap event recognizer 590. For purposes of illustration, the map view 305in FIG. 3A will be related to the reception of the sub-event sequence540, and the state transitions in double tap event recognizer 570 andtap event recognizer 590. Note that in this example, the sequence ofsub-events 540 defines a double tap gesture on a touch-sensitivedisplay, but the same event recognition technique could be applied inmyriad contexts, e.g., detecting a mouse double click, and/or inembodiments utilizing programmatic hierarchies of programmatic levels.

Before the first sub-event is delivered to actively involved eventrecognizers for map view 305, event recognizers 570 and 590 are in theevent recognition begins states 572 and 592, respectively. Followingdelivery of sub-events related to touch sub-event 301 to map view 305(as described above), double tap event recognizer 570 and tap eventrecognizer 590 transition to states event possible 574 and 594,respectively. This is because the event definition of a tap and a doubletap both begin with a touch such as detecting a finger down on atouch-sensitive surface.

As sub-event measure delay 541-2 is delivered to event recognizers 570and 590, both remain in states event possible 574 and 594, respectively.

Next, sub-event detect finger liftoff 541-3 is delivered to eventrecognizers 570 and 590. In this case, the state transitions for eventrecognizers 580 and 590 are different because the exemplar eventdefinitions for tap and double tap are different. In the case of tapevent recognizer 590, the final sub-event in the event definition is todetect finger liftoff, so the tap event recognizer 590 transitions tothe event recognized state 596.

Double tap recognizer 570 remains in state event possible 574, however,since a delay has begun, regardless of what the user may ultimately do.The complete event recognition definition for a double tap requiresanother delay, followed by a complete tap sub-event sequence though.This creates an ambiguous situation as between the tap event recognizer590, which is already in state event recognized 576, and the double taprecognizer 570, which is still in state event possible 574.

Accordingly, in some embodiments, event recognizers may implementexclusivity flags and exclusivity exception lists as discussed abovewith respect to FIGS. 3B and 3C. Here, the exclusivity flag 324 for tapevent recognizer 590 would be set, and additionally, exclusivityexception list 326 for tap event recognizer 590 would be configured tocontinue permitting delivery of sub-events to some event recognizers(such as double tap event recognizer 570) after tap event recognizer 590enters the state event recognized 596.

While tap event recognizer 590 remains in state event recognized 596,sub-event sequence 540 continues to be delivered to double tap eventrecognizer 570, where sub-events measure delay 541-4, detect finger down541-5, and measure delay 541-6, keep the double tap event recognizer 570in the state event possible 574; delivery of the final sub-event ofsequence 540, detect finger liftoff 541-7 transitions double tap eventrecognizer 570 to state event recognized 576.

At this point, the map view 305 takes the event double tap as recognizedby event recognizer 570, rather than the single tap event recognized bytap event recognizer 590. The decision to take the double tap event ismade in light of the combination of the tap event recognizer 590'sexclusivity flag 324 being set, the tap event recognizer 590'sexclusivity exception list 326 including a double tap event, and thefact that both the tap event recognizer 590 and the double tap eventrecognizer 570 both successfully recognized their respective eventtypes.

The following table presents in summarized tabular format the deliveryof sub-event sequence 540 as related to event recognizers 570 and 590,and sub-event handling process 440:

State: Double Tap State: Input Sub-Event Event Recognizer State: TapEvent Source Handling Sequence 540 570 Recognizer 590 Process 440 beforedelivery Event Recognition Event Recognition starts Begins 572 Begins592 detect finger Event Possible 574 Event Possible 594 Input Sequencedown 541-1 Begins 445 measure delay Event Possible 574 Event Possible594 Input sequence 541-2 continues 450 detect finger Event Possible 574Event Recognized Input sequence liftoff 541-3 596 continues 450 measuredelay Event Possible 574 Event Recognized Input sequence 541-4 596continues 450 detect finger Event Possible 574 Event Recognized Inputsequence down 541-5 596 continues 450 measure delay Event Possible 574Event Recognized Input sequence 541-6 596 continues 450 detect fingerEvent Recognized Event Recognized Input sequence liftoff 541-7 576 596ended 455

In another embodiment, in the event scenario of FIG. 5C, the single tapgesture is not recognized, because the single tap event recognizer has await-for list that identifies the double tap event recognizer. As aresult, a single tap gesture is not recognized until (if ever) thedouble tap event recognizer enters the event impossible state. In thisexample, in which a double tap gesture is recognized, the single tapevent recognizer would remain in the event possible state until thedouble tap gesture is recognized, at which point the single tap eventrecognizer would transition to the event impossible state.

Attention is now directed to FIGS. 6A and 6B, which are flow diagramsillustrating an event recognition method in accordance with someembodiments. The method 600 is performed at an electronic device, whichin some embodiments, may be an electronic device 102 or 104, asdiscussed above. In some embodiments, the electronic device may includea touch sensitive surface configured to detect multi-touch gestures.Alternatively, the electronic device may include a touch screenconfigured to detect multi-touch gestures.

The method 600 is configured to execute software that includes a viewhierarchy with a plurality of views. The method 600 displays 608 one ormore views of the view hierarchy, and executes 610 one or more softwareelements. Each software element is associated with a particular view,and each particular view includes one or more event recognizers, such asthose described in FIGS. 3B and 3C as event recognizer structures 320and 360, respectively.

Each event recognizer generally includes an event definition based onone or more sub-events, where the event definition may be implemented asa state machine, see e.g., FIG. 3B state machine 340. Event recognizersalso generally include an event handler, which specifies an action for atarget, and is configured to send the action to the target in responseto the event recognizer detecting an event corresponding to the eventdefinition.

In some embodiments, at least one of the plurality of event recognizersis a gesture recognizer having a gesture definition and a gesturehandler as noted in step 612 of FIG. 6A.

In some embodiments, the event definition defines a user gesture asnoted in step 614 of FIG. 6A.

Alternatively, event recognizers have a set of event recognition states616. These event recognition states may include at least an eventpossible state, an event impossible state, and an event recognizedstate.

In some embodiments, the event handler initiates preparation 618 of itscorresponding action for delivery to the target if the event recognizerenters the event possible state. As discussed above with respect to FIG.4A and the examples in FIGS. 5A-5C, the state machines implemented foreach event recognizer generally include an initial state, e.g., stateevent recognition begins 405. Receiving a sub-event that forms theinitial part of an event definition triggers a state change to the eventpossible state 410. Accordingly, in some embodiments, as an eventrecognizer transitions from the state event recognition begins 405 tothe state event possible 410, the event recognizer's event handler maybegin preparing its particular action to deliver to the eventrecognizer's target after an event is successfully recognized.

On the other hand, in some embodiments, the event handler may terminatepreparation 620 of its corresponding action if the event recognizerenters the state event impossible 420. In some embodiments, terminatingthe corresponding action includes canceling any preparation of the eventhandler's corresponding action.

The example of FIG. 5B is informative for this embodiment since tapevent recognizer 590 may have initiated preparation 618 of its action,but then, once the sub-event detect finger movement 531-3 is deliveredto the tap event recognizer 590, the recognizer 590 will transition tothe event impossible state 598, 578. At that point, tap event recognizer590 may terminate preparation 620 of the action for which it hadinitiated preparation 618.

In some embodiments, the event handler completes preparation 622 of itscorresponding action for delivery to the target if the event recognizerenters the event recognized state. The example of FIG. 5C illustratesthis embodiment since a double tap is recognized by actively involvedevent recognizers for the map view 305, which in some implementations,would be the event bound to selecting and/or executing the search resultdepicted by map view 305. Here, after the double tap event recognizer570 successfully recognizes the double tap event comprised of thesub-event sequence 540, map view 305's event handler completespreparation 622 of its action, namely, indicating that it has receivedan activation command.

In some embodiments, the event handler delivers 624 its correspondingaction to the target associated with the event recognizer. Continuingwith the example of FIG. 5C, the action prepared, i.e. the activationcommand of the map view 305, would be delivered to the specific targetassociated with the map view 305, which may be any suitable programmaticmethod or object.

Alternatively, the plurality of event recognizers may independentlyprocess 626 the sequence of one or more sub-events in parallel.

In some embodiments, one or more event recognizers may be configured asexclusive event recognizers 628, as discussed above with respect toFIGS. 3B and 3C's exclusivity flags 324 and 364, respectively. When anevent recognizer is configured as an exclusive event recognizer, theevent delivery system prevents any other event recognizers for activelyinvolved views (except those listed in the exception list 326, 366 ofthe event recognizer that recognizes the event) in the view hierarchyfrom receiving subsequent sub-events (of the same sequence ofsub-events) after the exclusive event recognizer recognizes an event.Furthermore, when a non-exclusive event recognizer recognizes an event,the event delivery system prevents any exclusive event recognizers foractively involved views in the view hierarchy from receiving subsequentsub-events, except for those (if any) listed in the exception list 326,366 of the event recognizer that recognizes the event.

In some embodiments, exclusive event recognizers may include 630 anevent exception list, as discussed above with respect to FIGS. 3B and3C's exclusivity exception lists 326 and 366, respectively. As noted inthe discussion of FIG. 5C above, an event recognizer's exclusivityexception list can be used to permit event recognizers to continue withevent recognition even when the sequence of sub-events making up theirrespective event definitions overlap. Accordingly, in some embodiments,the event exception list includes events whose corresponding eventdefinitions have repetitive sub-events 632, such as the singletap/double tap event example of FIG. 5C.

Alternately, the event definition may define a user input operation 634.

In some embodiments, one or more event recognizers may be adapted todelay delivering every sub-event of the sequence of sub-events untilafter the event is recognized.

The method 600 detects 636 a sequence of one or more sub-events, and insome embodiments, the sequence of one or more sub-events may includeprimitive touch events 638. Primitive touch events may include, withoutlimitation, basic components of a touch-based gesture on atouch-sensitive surface, such as data related to an initial finger orstylus touch down, data related to initiation of multi-finger or stylusmovement across a touch-sensitive surface, dual finger movements inopposing directions, stylus lift off from a touch-sensitive surface,etc.

Sub-events in the sequence of one or more sub-events can include manyforms, including without limitation, key presses, key press holds, keypress releases, button presses, button press holds, button pressreleases, joystick movements, mouse movements, mouse button presses,mouse button releases, pen stylus touches, pen stylus movements, penstylus releases, oral instructions, detected eye movements, biometricinputs, and detected physiological changes in a user, among others.

The method 600 identifies 640 one of the views of the view hierarchy asa hit view. The hit view establishes which views in the view hierarchyare actively involved views. An example is depicted in FIG. 3A, wherethe actively involved views 306 include search results panel 304, andmaps view 305 because touch sub-event 301 contacted the area associatedwith the maps view 305.

In some embodiments, a first actively involved view within the viewhierarchy may be configured 642 to prevent delivery of the respectivesub-event to event recognizers associated with that first activelyinvolved view. This behavior can implement the skip property discussedabove with respect to FIGS. 3B and 3C (330 and 370, respectively). Whenthe skip property is set for an event recognizer, delivery of therespective sub-event is still performed for event recognizers associatedwith other actively involved views in the view hierarchy.

Alternately, a first actively involved view within the view hierarchymay be configured 644 to prevent delivery of the respective sub-event toevent recognizers associated with that first actively involved viewunless the first actively involved view is the hit view. This behaviorcan implement the conditional skip property discussed above with respectto FIGS. 3B and 3C (332 and 372, respectively).

In some embodiments, a second actively involved view within the viewhierarchy is configured 646 to prevent delivery of the respectivesub-event to event recognizers associated with the second activelyinvolved view and to event recognizers associated with ancestors of thesecond actively involved view. This behavior can implement the stopproperty discussed above with respect to FIGS. 3B and 3C (328 and 368,respectively).

The method 600 delivers 648 a respective sub-event to event recognizersfor each actively involved view within the view hierarchy. In someembodiments, event recognizers for actively involved views in the viewhierarchy process the respective sub-event prior to processing a nextsub-event in the sequence of sub-events. Alternately, event recognizersfor the actively involved views in the view hierarchy make theirsub-event recognition decisions while processing the respectivesub-event.

In some embodiments, event recognizers for actively involved views inthe view hierarchy may process the sequence of one or more sub-eventsconcurrently 650; alternatively, event recognizers for actively involvedviews in the view hierarchy may process the sequence of one or moresub-events in parallel.

In some embodiments, one or more event recognizers may be adapted todelay delivering 652 one or more sub-events of the sequence ofsub-events until after the event recognizer recognizes the event. Thisbehavior reflects a delayed event. For example, consider a single tapgesture in a view for which multiple tap gestures are possible. In thatcase, a tap event becomes a “tap+delay” recognizer. In essence, when anevent recognizer implements this behavior, the event recognizer willdelay event recognition until it is certain that the sequence ofsub-events does in fact correspond to its event definition. Thisbehavior may be appropriate when a recipient view is incapable ofappropriately responding to cancelled events. In some embodiments, anevent recognizer will delay updating its event recognition status to itsrespective actively involved view until the event recognizer is certainthat the sequence of sub-events does not correspond to its eventdefinition. As discussed above with respect to FIGS. 3B and 3C, delaytouch began flag 328, 368, delay touch end flag 330, 370, and touchcancellation flag 332, 372 are provided to tailor sub-event deliverytechniques, as well as event recognizer and view status informationupdates to specific needs.

The foregoing description, for purpose of explanation, has beendescribed with reference to specific embodiments. However, theillustrative discussions above are not intended to be exhaustive or tolimit the invention to the precise forms disclosed. Many modificationsand variations are possible in view of the above teachings. Theembodiments were chosen and described in order to best explain theprinciples of the invention and its practical applications, to therebyenable others skilled in the art to best utilize the invention andvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. A non-transitory computer readable storage mediumstoring software that includes a view hierarchy with a plurality ofviews and instructions for execution by one of more processors of anelectronic device having a touch-sensitive display, the instructionsfor: at the electronic having the touch-sensitive display: detecting oneor more touches on the touch-sensitive display within a view thatcorresponds to a region of a user interface displayed on thetouch-sensitive display; obtaining a sequence of touch sub-events thatcorrespond to one or more touches within the view; providing thesequence of touch sub-events to a plurality of gesture recognizers thatare associated with the view, including a first gesture recognizer and asecond gesture recognizer; and detecting a transition in state of thefirst gesture recognizer with respect to recognizing a gesture based onthe sequence of touch sub-events; and, in response to detecting thetransition in state of the first gesture recognizer: in accordance witha determination that the first gesture recognizer has transitioned to astate in which a gesture that corresponds to the sequence of touchsub-events has been recognized, transitioning the second gesturerecognizer into a state in which the second gesture recognizer isprevented from recognizing a gesture that corresponds to the sequence oftouch sub-events, and performing an action corresponding to the gesturerecognized by the first gesture recognizer in an application associatedwith the view.
 2. The non-transitory computer readable storage medium ofclaim 1, wherein the software includes instructions for responding todetecting the transition in state of the first gesture recognizer byenabling the second gesture recognizer, in accordance with adetermination that the first gesture recognizer has transitioned to astate in which the first gesture recognizer is prevented fromrecognizing a gesture that corresponds to the sequence of touchsub-events, to recognize a gesture that corresponds to the sequence oftouch sub-events.
 3. The non-transitory computer readable storage mediumof claim 1, wherein the software includes instructions for: detectingthat the sequence of touch sub-events corresponds to a gesturerecognized by the first gesture recognizer; and, in response todetecting that the sequence of touch sub-events corresponds to a gesturerecognized by the first gesture recognizer, preventing the secondgesture recognizer from recognizing a gesture that corresponds to thesequence of touch sub-events.
 4. The non-transitory computer readablestorage medium of claim 3, wherein preventing the second gesturerecognizer from recognizing a gesture that corresponds to the sequenceof touch sub-events includes transitioning the second gesture recognizerinto the state in which the second gesture is prevented from recognizinga gesture that corresponds to the sequence of touch sub-events.
 5. Thenon-transitory computer readable storage medium of claim 1, wherein thetouch sub-events are provided to the plurality of gesture recognizersover a period of time, and during the period of time: the first gesturerecognizer evaluates the sequence of touch events to determine whetherthe sequence of touch events meet gesture recognition criteria for thefirst gesture recognizer; and the second gesture recognizer evaluatesthe sequence of touch events to determine whether the sequence of touchevents meet gesture recognition criteria for the second gesturerecognizer.
 6. The non-transitory computer readable storage medium ofclaim 5, wherein the evaluation of the sequence of touch events by thefirst gesture recognizer occurs concurrently with the evaluation of thesequence of touch events by the second gesture recognizer.
 7. Thenon-transitory computer readable storage medium of claim 1, wherein thefirst gesture recognizer is configured to delay delivering the sequenceof touch sub-events to the view until after the first gesture recognizerfails to recognize the sequence of touch sub-events.
 8. Thenon-transitory computer readable storage medium of claim 1, wherein thesoftware includes instructions for, in accordance with a determinationthat the second gesture recognizer has transitioned to the state inwhich the gesture that corresponds to the sequence of touch sub-eventshas been recognized, causing the first gesture recognizer to transitioninto a state in which the first gesture recognizer is prevented fromrecognizing the gesture that corresponds to the sequence of touchsub-events.
 9. The non-transitory computer readable storage medium ofclaim 1, wherein the second gesture recognizer is associated with a listof one or more gesture recognizers and the list of one or more gesturerecognizers includes the first gesture recognizer.
 10. An electronicdevice, comprising: a touch-sensitive display; one or more processors;and memory storing software that includes a view hierarchy with aplurality of views and instructions, which, when executed by the one ormore processors, cause the electronic device to perform a methodincluding: detecting one or more touches on the touch-sensitive displaywithin a view that corresponds to a region of a user interface displayedon the touch-sensitive display; obtaining a sequence of touch sub-eventsthat correspond to one or more touches within the view; providing thesequence of touch sub-events to a plurality of gesture recognizers thatare associated with the view, including a first gesture recognizer and asecond gesture recognizer; and detecting a transition in state of thefirst gesture recognizer with respect to recognizing a gesture based onthe sequence of touch sub-events; and, in response to detecting thetransition in state of the first gesture recognizer: in accordance witha determination that the first gesture recognizer has transitioned to astate in which a gesture that corresponds to the sequence of touchsub-events has been recognized, transitioning the second gesturerecognizer into a state in which the second gesture recognizer isprevented from recognizing a gesture that corresponds to the sequence oftouch sub-events, and performing an action corresponding to the gesturerecognized by the first gesture recognizer in an application associatedwith the view.
 11. The electronic device of claim 10, wherein thesoftware includes instructions for responding to detecting thetransition in state of the first gesture recognizer by enabling thesecond gesture recognizer, in accordance with a determination that thefirst gesture recognizer has transitioned to a state in which the firstgesture recognizer is prevented from recognizing a gesture thatcorresponds to the sequence of touch sub-events, to recognize a gesturethat corresponds to the sequence of touch sub-events.
 12. A method,comprising, at a device with a touch-sensitive display: detecting one ormore touches on the touch-sensitive display within a view thatcorresponds to a region of a user interface displayed on thetouch-sensitive display; obtaining a sequence of touch sub-events thatcorrespond to one or more touches within the view; providing thesequence of touch sub-events to a plurality of gesture recognizers thatare associated with the view, including a first gesture recognizer and asecond gesture recognizer; and detecting a transition in state of thefirst gesture recognizer with respect to recognizing a gesture based onthe sequence of touch sub-events; and, in response to detecting thetransition in state of the first gesture recognizer: in accordance witha determination that the first gesture recognizer has transitioned to astate in which a gesture that corresponds to the sequence of touchsub-events has been recognized, transitioning the second gesturerecognizer into a state in which the second gesture recognizer isprevented from recognizing a gesture that corresponds to the sequence oftouch sub-events, and performing an action corresponding to the gesturerecognized by the first gesture recognizer in an application associatedwith the view.
 13. The method of claim 12, including: in response todetecting the transition in state of the first gesture recognizer: inaccordance with a determination that the first gesture recognizer hastransitioned to a state in which the first gesture recognizer isprevented from recognizing a gesture that corresponds to the sequence oftouch sub-events, enabling the second gesture recognizer to recognize agesture that corresponds to the sequence of touch sub-events.
 14. Themethod of claim 12, including: detecting that the sequence of touchsub-events corresponds to a gesture recognized by the first gesturerecognizer; and, in response to detecting that the sequence of touchsub-events corresponds to a gesture recognized by the first gesturerecognizer, preventing the second gesture recognizer from recognizing agesture that corresponds to the sequence of touch sub-events.
 15. Themethod of claim 14, wherein preventing the second gesture recognizerfrom recognizing a gesture that corresponds to the sequence of touchsub-events includes transitioning the second gesture recognizer into thestate in which the second gesture is prevented from recognizing agesture that corresponds to the sequence of touch sub-events.
 16. Themethod of claim 12, wherein: the touch sub-events are provided to theplurality of gesture recognizers over a period of time; during theperiod of time: the first gesture recognizer evaluates the sequence oftouch events to determine whether the sequence of touch events meetgesture recognition criteria for the first gesture recognizer; and thesecond gesture recognizer evaluates the sequence of touch events todetermine whether the sequence of touch events meet gesture recognitioncriteria for the second gesture recognizer.
 17. The method of claim 16,wherein the evaluation of the sequence of touch events by the firstgesture recognizer occurs concurrently with the evaluation of thesequence of touch events by the second gesture recognizer.
 18. Themethod of claim 12, wherein the first gesture recognizer is configuredto delay delivering the sequence of touch sub-events to the view untilafter the first gesture recognizer fails to recognize the sequence oftouch sub-events.
 19. The method of claim 12, including: in accordancewith a determination that the second gesture recognizer has transitionedto the state in which the gesture that corresponds to the sequence oftouch sub-events has been recognized, causing the first gesturerecognizer to transition into a state in which the first gesturerecognizer is prevented from recognizing the gesture that corresponds tothe sequence of touch sub-events.
 20. The method of claim 12, whereinthe second gesture recognizer is associated with a list of one or moregesture recognizers and the list of one or more gesture recognizersincludes the first gesture recognizer.